 #include "creatures.h"
#include <stdio.h>
#include <stdlib.h>

int getCreaId(const Creature *pCreature)
{
    return(pCreature->id);
}

int getCreaType(const Creature *pCreature)
{
    return(pCreature->type);
}
int getCreaDegats(const Creature *pCreature)
{
    return(pCreature->degats);
}

int getCreaNbPV(const Creature *pCreature)
{
    return(pCreature->nbPV);
}

int getCreaButin(const Creature *pCreature)
{
    return(pCreature->butin);
}

int getCreaPositionx(const Creature *pCreature)
{
    return(pCreature->positionx);
}

int getCreaPositiony(const Creature *pCreature)
{
    return(pCreature->positiony);
}

int getCreaPositionxPrec(const Creature *pCreature)
{
    return(pCreature->positionxprec);
}


void setCreaId(Creature *pCreature, const int idRecu)
{
     pCreature->id=idRecu;
}

void setCreaType(Creature *pCreature, const int typeRecu)
{
     pCreature->type=typeRecu;
}

void setCreaDegats(Creature *pCreature, const int degatsRecu)
{
     pCreature->degats=degatsRecu;
}

void setCreaNbPV(Creature *pCreature, const int nbPVRecu)
{
     pCreature->nbPV=nbPVRecu;
}

void setCreaButin(Creature *pCreature, const int butinRecu)
{
     pCreature->butin=butinRecu;
}

void setCreaPositionx(Creature *pCreature, const int positionxRecu)
{
     pCreature->positionx=positionxRecu;
}
void setCreaPositiony(Creature *pCreature, const int positionyRecu)
{
     pCreature->positiony=positionyRecu;
}

void setCreaPositionxPrec(Creature *pCreature, const int positionxPrecRecu)
{
    pCreature->positionxprec=positionxPrecRecu;
}

Creature* creerNouvelleCreature(int type, int id)
{
         Creature *creature;

         creature = (Creature*) malloc (sizeof(Creature));

         setCreaId(creature,id);
         setCreaType(creature,type);
         setCreaPositionx(creature,0);
         setCreaPositiony(creature,5);
         setCreaPositionxPrec(creature,0);

         switch(type)
         {
                     case 1:
                          setCreaDegats(creature,5);
                          setCreaNbPV(creature,1);
                          setCreaButin(creature,1);
                          break;

                     case 2:
                          setCreaDegats(creature,10);
                          setCreaNbPV(creature,5);
                          setCreaButin(creature,10);
                          break;

                     case 3:
                          setCreaDegats(creature,20);
                          setCreaNbPV(creature,10);
                          setCreaButin(creature,25);
                          break;

                     case 4:
                          setCreaDegats(creature,40);
                          setCreaNbPV(creature,20);
                          setCreaButin(creature,50);
                          break;

                     case 5:
                          setCreaDegats(creature,60);
                          setCreaNbPV(creature,50);
                          setCreaButin(creature,125);
                          break;

         }

         return(creature);
}




